from math import tan,radians,log2,ceil

def get_height(dist,angle):
    return tan(radians(angle)) * dist

def main():
    while True:
        d = float(input('Enter distance (0 to exit): '))
        if d == 0:
            print('Bye!')
            break
        a = float(input('Enter angle of elevation: '))
        print('Height of the tree is',get_height(d,a))


# main()


n = int(input('Enter size of range: '))
x = ceil(log2(n+1))   # ceil函数将接受到的数字向上舍入大于或等于输入的最小整数
print('Max. number of guess needed is',x)



